package com.lalosoft.misgastos.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.lalosoft.misgastos.config.GastosManager;
import com.lalosoft.misgastos.service.RecalculateService;

public class BootReceiver extends BroadcastReceiver {
	
	private static String LOG_TAG = "BootReceiver";

	@Override
	public void onReceive(Context context, Intent intent) {
		
		Log.d(LOG_TAG, "BroadcastReceiver on BOOT, onReceive...");
		Log.d(LOG_TAG, "Se ha iniciado el telefono");
		GastosManager manager = GastosManager.getInstance(context);
		if(!manager.isFirstTime()){
			Intent i = new Intent(context, RecalculateService.class);
			context.startService(i);
			Log.d(LOG_TAG, "Se ha iniciado la aplicacion anteriormente!");
		}

	}
	

}